# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Monitoring.V3.Model.BasicSli do
  @moduledoc """
  An SLI measuring performance on a well-known service type. Performance will be computed on the basis of pre-defined metrics. The type of the service_resource determines the metrics to use and the service_resource.labels and metric_labels are used to construct a monitoring filter to filter that metric down to just the data relevant to this service.

  ## Attributes

  *   `availability` (*type:* `GoogleApi.Monitoring.V3.Model.AvailabilityCriteria.t`, *default:* `nil`) - Good service is defined to be the count of requests made to this service that return successfully.
  *   `latency` (*type:* `GoogleApi.Monitoring.V3.Model.LatencyCriteria.t`, *default:* `nil`) - Good service is defined to be the count of requests made to this service that are fast enough with respect to latency.threshold.
  *   `location` (*type:* `list(String.t)`, *default:* `nil`) - OPTIONAL: The set of locations to which this SLI is relevant. Telemetry from other locations will not be used to calculate performance for this SLI. If omitted, this SLI applies to all locations in which the Service has activity. For service types that don't support breaking down by location, setting this field will result in an error.
  *   `method` (*type:* `list(String.t)`, *default:* `nil`) - OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from other methods will not be used to calculate performance for this SLI. If omitted, this SLI applies to all the Service's methods. For service types that don't support breaking down by method, setting this field will result in an error.
  *   `version` (*type:* `list(String.t)`, *default:* `nil`) - OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry from other API versions will not be used to calculate performance for this SLI. If omitted, this SLI applies to all API versions. For service types that don't support breaking down by version, setting this field will result in an error.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :availability => GoogleApi.Monitoring.V3.Model.AvailabilityCriteria.t() | nil,
          :latency => GoogleApi.Monitoring.V3.Model.LatencyCriteria.t() | nil,
          :location => list(String.t()) | nil,
          :method => list(String.t()) | nil,
          :version => list(String.t()) | nil
        }

  field(:availability, as: GoogleApi.Monitoring.V3.Model.AvailabilityCriteria)
  field(:latency, as: GoogleApi.Monitoring.V3.Model.LatencyCriteria)
  field(:location, type: :list)
  field(:method, type: :list)
  field(:version, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Monitoring.V3.Model.BasicSli do
  def decode(value, options) do
    GoogleApi.Monitoring.V3.Model.BasicSli.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Monitoring.V3.Model.BasicSli do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
